from time import sleep

from selenium.webdriver.common.by import By

from base.base import Base


class Page(Base):
    sousuo='/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextView'
    shuru='com.xiachufang:id/search_edit_text'
    anniu='/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[3]/android.widget.TextView'
    dy='/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[2]/android.widget.TextView'
    dyy='new UiSelector().resourceId(com.xiachufang:id/tv_content)'
    dyy1='new UiSelector().text(这个页面是空的)'
    dy1='com.xiachufang:id/tv_load_status_major'
    def sousuoyewu(self,filename):
        self.loc_ele(By.XPATH,self.sousuo).click()
        sleep(2)
        self.loc_ele(By.ID,self.shuru).send_keys(filename)
        sleep(2)
        self.loc_ele(By.XPATH,self.anniu).click()
        sleep(2)